package wzc.design_pattern.behaviour.memento;

/**
 * @Author 那和不是个啥
 * @Date 2025/7/20
 * @Description
 */

public class TextEditor {
    private String text;

    public void setText(String text) {
        this.text = text;
    }

    public String getText() {
        return text;
    }

    public TextMemento save() {
        return new TextMemento(text);
    }

    public void restore(TextMemento memento) {
        text = memento.text();
    }
}
